#include <length.h>
#include <structure.h>
#include <MutexLock.h>
#include <OSProc.h>
//The abstract stream of File
//ABS_STREAM is its origin
//partly rewrite the 'IFD***'
//the combination of IFD & Stream

#define u32  unsigned int
#define u16  unsigned short
#define u8  unsigned char



//#define INHERIT_FROM_DELEGATE_STREAM		\
  _length stat;					\
  u32* object;					\
  _mlock streamlocker; /*protect fileStream*/	\
  _libs* lib;							\
  _length size;
  // slnode* buffers;						\
  //  _mlock bufferlock;  /*protect the buffers*/		\
  //  _file_op* func;     /*the Address of the drive func*/


#include "struct_fileStream.h"
#include <IPC/LibMemory.h>
//#include "struct_fileStream.h"

#define strType _fstr
static _length __GetStreamLength(strType of)
{
  return of->size;
}

_libs* STRFUNC(MapStream)(strType stream,_ptlong* addr,_length num, _length offset)
{
  return FileStreamToLibMemory(stream,NOW,addr,num,offset);
}
//equal to FileStreamToLib
strType STRFUNC(UnmapStream)(_libs* lib)
{
  return LibMemoryToFileStream(NOW,lib);
}
//equal to LibMemoryToStream
